package com.itheima.method;

public class Demo1 {
    public static void main(String[] args) {
//设计一个方法,求任意数四舍五入后的结果并打印

        double num = 3.15;
       int num1 =print(num);
        System.out.println(num1);

    }

    public static int print(double n){

        if(n * 10 % 10 <5){
           return((int)n*10/10);
        }else{
            return((int)n*10/10 + 1);
        }

    }

}
